<template>
  <tl-ref-tree v-model="valueBridge" :singleSelect="true" :initDisplayData.sync="initDisplayDataBridge" refTitle="tab选择" v-bind="inputProps" v-on="{ confirm }" queryTreeUrl="/pm/indexTabList/queryTreeList" queryDataUrl="/pm/indexTabList/list" treeQueryKey="qry_parentid"></tl-ref-tree>
</template>

<script>
/** mixins */
import { mixin_ref_list } from '@tapui/mixins/mixin_ref_list'
/** 子组件 */
/** 工具类 */
import { queryDataCode } from '@tapui/api/dataCode'
import { getAction, putAction, postAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  name: 'TlPmIndexTabTreeListRef',
  data() {
    return {
      valueBridge: undefined,
      initDisplayDataBridge: ''
    }
  },
  props: {
    value: {
      default: '',
      type: [String, Number]
    },
    initDisplayData: {
      default: '',
      type: String
    },
    isHeaderDisplay: {
      default: true,
      type: Boolean
    },
    isDisplayDefaultElement: {
      default: true,
      type: Boolean
    },
    width: {
      default: '',
      type: String
    }
  },
  computed: {
    inputProps() {
      return this.$attrs
    }
  },
  methods: {
    confirm(datas) {
      this.$emit('getpmIndexTabTreeListRefData', datas)
    }
  },
  watch: {
    value(newVal, oldVal) {
      this.valueBridge = newVal
    },
    valueBridge(newVal, oldVal) {
      this.$emit('input', newVal)
    },
    initDisplayData(newVal, oldVal) {
      this.initDisplayDataBridge = newVal
    },
    initDisplayDataBridge(newVal, oldVal) {
      this.$emit('update:initDisplayData', newVal)
    }
  }
}
</script>

